package edu.unf.cen6940.domain;

import java.io.Serializable;

import java.lang.StringBuilder;

import java.util.LinkedHashSet;
import java.util.Set;

import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;

import javax.xml.bind.annotation.*;

import javax.persistence.*;

/**
 */

@Entity
@NamedQueries({
		@NamedQuery(name = "findAllFacultys", query = "select myFaculty from Faculty myFaculty"),
		@NamedQuery(name = "findFacultyByActive", query = "select myFaculty from Faculty myFaculty where myFaculty.active = ?1"),
		@NamedQuery(name = "findFacultyByActiveContaining", query = "select myFaculty from Faculty myFaculty where myFaculty.active like ?1"),
		@NamedQuery(name = "findFacultyByEmail", query = "select myFaculty from Faculty myFaculty where myFaculty.email = ?1"),
		@NamedQuery(name = "findFacultyByEmailContaining", query = "select myFaculty from Faculty myFaculty where myFaculty.email like ?1"),
		@NamedQuery(name = "findFacultyByFacultyId", query = "select myFaculty from Faculty myFaculty where myFaculty.facultyId = ?1"),
		@NamedQuery(name = "findFacultyByFirstName", query = "select myFaculty from Faculty myFaculty where myFaculty.firstName = ?1"),
		@NamedQuery(name = "findFacultyByFirstNameContaining", query = "select myFaculty from Faculty myFaculty where myFaculty.firstName like ?1"),
		@NamedQuery(name = "findFacultyByLastName", query = "select myFaculty from Faculty myFaculty where myFaculty.lastName = ?1"),
		@NamedQuery(name = "findFacultyByLastNameContaining", query = "select myFaculty from Faculty myFaculty where myFaculty.lastName like ?1"),
		@NamedQuery(name = "findFacultyByNnumber", query = "select myFaculty from Faculty myFaculty where myFaculty.nnumber = ?1"),
		@NamedQuery(name = "findFacultyByNnumberContaining", query = "select myFaculty from Faculty myFaculty where myFaculty.nnumber like ?1"),
		@NamedQuery(name = "findFacultyByPrimaryKey", query = "select myFaculty from Faculty myFaculty where myFaculty.facultyId = ?1"),
		@NamedQuery(name = "findFacultyByUrl", query = "select myFaculty from Faculty myFaculty where myFaculty.url = ?1"),
		@NamedQuery(name = "findFacultyByUrlContaining", query = "select myFaculty from Faculty myFaculty where myFaculty.url like ?1") })
@Table(catalog = "ThesisManagement", name = "Faculty")
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(namespace = "rms_test/edu/unf/cen6940/domain", name = "Faculty")
@XmlRootElement(namespace = "rms_test/edu/unf/cen6940/domain")
public class Faculty implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 */

	@Column(name = "facultyID", nullable = false)
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	@Basic(fetch = FetchType.EAGER)
	@Id
	@XmlElement
	Integer facultyId;
	/**
	 */

	@Column(name = "nNumber", length = 10, nullable = false)
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	String nnumber;
	/**
	 */

	@Column(name = "firstName", length = 30, nullable = false)
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	String firstName;
	/**
	 */

	@Column(name = "lastName", length = 45, nullable = false)
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	String lastName;
	/**
	 */

	@Column(name = "email", length = 50, nullable = false)
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	String email;
	/**
	 */

	@Column(name = "URL", length = 75)
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	String url;
	/**
	 */

	@Column(name = "active", length = 10)
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	String active;

	/**
	 */
	@OneToMany(mappedBy = "faculty", cascade = { CascadeType.REMOVE }, fetch = FetchType.LAZY)
	@XmlElement(name = "", namespace = "")
	java.util.Set<edu.unf.cen6940.domain.Facultyresearchtostudent> facultyresearchtostudents;
	/**
	 */
	@OneToMany(mappedBy = "facultyByCommitteeMember1", cascade = { CascadeType.REMOVE }, fetch = FetchType.LAZY)
	@XmlElement(name = "", namespace = "")
	java.util.Set<edu.unf.cen6940.domain.Thesiscommittee> thesiscommitteesForChair;
	/**
	 */
	@OneToMany(mappedBy = "facultyByCommitteeMember1", cascade = { CascadeType.REMOVE }, fetch = FetchType.LAZY)
	@XmlElement(name = "", namespace = "")
	java.util.Set<edu.unf.cen6940.domain.Thesiscommittee> thesiscommitteesForCommitteeMember1;
	/**
	 */
	@OneToMany(mappedBy = "facultyByCommitteeMember1", cascade = { CascadeType.REMOVE }, fetch = FetchType.LAZY)
	@XmlElement(name = "", namespace = "")
	java.util.Set<edu.unf.cen6940.domain.Thesiscommittee> thesiscommitteesForCommitteeMember5;
	/**
	 */
	@OneToMany(mappedBy = "facultyByCommitteeMember1", cascade = { CascadeType.REMOVE }, fetch = FetchType.LAZY)
	@XmlElement(name = "", namespace = "")
	java.util.Set<edu.unf.cen6940.domain.Thesiscommittee> thesiscommitteesForCommitteeMember4;
	/**
	 */
	@OneToMany(mappedBy = "facultyByCommitteeMember1", cascade = { CascadeType.REMOVE }, fetch = FetchType.LAZY)
	@XmlElement(name = "", namespace = "")
	java.util.Set<edu.unf.cen6940.domain.Thesiscommittee> thesiscommitteesForCommitteeMember3;
	/**
	 */
	@OneToMany(mappedBy = "faculty", cascade = { CascadeType.REMOVE }, fetch = FetchType.LAZY)
	@XmlElement(name = "", namespace = "")
	java.util.Set<edu.unf.cen6940.domain.Facultyresearch> facultyresearchs;
	/**
	 */
	@OneToMany(mappedBy = "facultyByCommitteeMember1", cascade = { CascadeType.REMOVE }, fetch = FetchType.LAZY)
	@XmlElement(name = "", namespace = "")
	java.util.Set<edu.unf.cen6940.domain.Thesiscommittee> thesiscommitteesForCommitteeMember2;

	/**
	 */
	public void setFacultyId(Integer facultyId) {
		this.facultyId = facultyId;
	}

	/**
	 */
	public Integer getFacultyId() {
		return this.facultyId;
	}

	/**
	 */
	public void setNnumber(String nnumber) {
		this.nnumber = nnumber;
	}

	/**
	 */
	public String getNnumber() {
		return this.nnumber;
	}

	/**
	 */
	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}

	/**
	 */
	public String getFirstName() {
		return this.firstName;
	}

	/**
	 */
	public void setLastName(String lastName) {
		this.lastName = lastName;
	}

	/**
	 */
	public String getLastName() {
		return this.lastName;
	}

	/**
	 */
	public void setEmail(String email) {
		this.email = email;
	}

	/**
	 */
	public String getEmail() {
		return this.email;
	}

	/**
	 */
	public void setUrl(String url) {
		this.url = url;
	}

	/**
	 */
	public String getUrl() {
		return this.url;
	}

	/**
	 */
	public void setActive(String active) {
		this.active = active;
	}

	/**
	 */
	public String getActive() {
		return this.active;
	}

	/**
	 */
	public void setFacultyresearchtostudents(Set<Facultyresearchtostudent> facultyresearchtostudents) {
		this.facultyresearchtostudents = facultyresearchtostudents;
	}

	/**
	 */
	public Set<Facultyresearchtostudent> getFacultyresearchtostudents() {
		if (facultyresearchtostudents == null) {
			facultyresearchtostudents = new java.util.LinkedHashSet<edu.unf.cen6940.domain.Facultyresearchtostudent>();
		}
		return facultyresearchtostudents;
	}

	/**
	 */
	public void setThesiscommitteesForChair(Set<Thesiscommittee> thesiscommitteesForChair) {
		this.thesiscommitteesForChair = thesiscommitteesForChair;
	}

	/**
	 */
	public Set<Thesiscommittee> getThesiscommitteesForChair() {
		if (thesiscommitteesForChair == null) {
			thesiscommitteesForChair = new java.util.LinkedHashSet<edu.unf.cen6940.domain.Thesiscommittee>();
		}
		return thesiscommitteesForChair;
	}

	/**
	 */
	public void setThesiscommitteesForCommitteeMember1(Set<Thesiscommittee> thesiscommitteesForCommitteeMember1) {
		this.thesiscommitteesForCommitteeMember1 = thesiscommitteesForCommitteeMember1;
	}

	/**
	 */
	public Set<Thesiscommittee> getThesiscommitteesForCommitteeMember1() {
		if (thesiscommitteesForCommitteeMember1 == null) {
			thesiscommitteesForCommitteeMember1 = new java.util.LinkedHashSet<edu.unf.cen6940.domain.Thesiscommittee>();
		}
		return thesiscommitteesForCommitteeMember1;
	}

	/**
	 */
	public void setThesiscommitteesForCommitteeMember5(Set<Thesiscommittee> thesiscommitteesForCommitteeMember5) {
		this.thesiscommitteesForCommitteeMember5 = thesiscommitteesForCommitteeMember5;
	}

	/**
	 */
	public Set<Thesiscommittee> getThesiscommitteesForCommitteeMember5() {
		if (thesiscommitteesForCommitteeMember5 == null) {
			thesiscommitteesForCommitteeMember5 = new java.util.LinkedHashSet<edu.unf.cen6940.domain.Thesiscommittee>();
		}
		return thesiscommitteesForCommitteeMember5;
	}

	/**
	 */
	public void setThesiscommitteesForCommitteeMember4(Set<Thesiscommittee> thesiscommitteesForCommitteeMember4) {
		this.thesiscommitteesForCommitteeMember4 = thesiscommitteesForCommitteeMember4;
	}

	/**
	 */
	public Set<Thesiscommittee> getThesiscommitteesForCommitteeMember4() {
		if (thesiscommitteesForCommitteeMember4 == null) {
			thesiscommitteesForCommitteeMember4 = new java.util.LinkedHashSet<edu.unf.cen6940.domain.Thesiscommittee>();
		}
		return thesiscommitteesForCommitteeMember4;
	}

	/**
	 */
	public void setThesiscommitteesForCommitteeMember3(Set<Thesiscommittee> thesiscommitteesForCommitteeMember3) {
		this.thesiscommitteesForCommitteeMember3 = thesiscommitteesForCommitteeMember3;
	}

	/**
	 */
	public Set<Thesiscommittee> getThesiscommitteesForCommitteeMember3() {
		if (thesiscommitteesForCommitteeMember3 == null) {
			thesiscommitteesForCommitteeMember3 = new java.util.LinkedHashSet<edu.unf.cen6940.domain.Thesiscommittee>();
		}
		return thesiscommitteesForCommitteeMember3;
	}

	/**
	 */
	public void setFacultyresearchs(Set<Facultyresearch> facultyresearchs) {
		this.facultyresearchs = facultyresearchs;
	}

	/**
	 */
	public Set<Facultyresearch> getFacultyresearchs() {
		if (facultyresearchs == null) {
			facultyresearchs = new java.util.LinkedHashSet<edu.unf.cen6940.domain.Facultyresearch>();
		}
		return facultyresearchs;
	}

	/**
	 */
	public void setThesiscommitteesForCommitteeMember2(Set<Thesiscommittee> thesiscommitteesForCommitteeMember2) {
		this.thesiscommitteesForCommitteeMember2 = thesiscommitteesForCommitteeMember2;
	}

	/**
	 */
	public Set<Thesiscommittee> getThesiscommitteesForCommitteeMember2() {
		if (thesiscommitteesForCommitteeMember2 == null) {
			thesiscommitteesForCommitteeMember2 = new java.util.LinkedHashSet<edu.unf.cen6940.domain.Thesiscommittee>();
		}
		return thesiscommitteesForCommitteeMember2;
	}

	/**
	 */
	public Faculty() {
	}

	/**
	 * Copies the contents of the specified bean into this bean.
	 *
	 */
	public void copy(Faculty that) {
		setFacultyId(that.getFacultyId());
		setNnumber(that.getNnumber());
		setFirstName(that.getFirstName());
		setLastName(that.getLastName());
		setEmail(that.getEmail());
		setUrl(that.getUrl());
		setActive(that.getActive());
		setFacultyresearchtostudents(new java.util.LinkedHashSet<edu.unf.cen6940.domain.Facultyresearchtostudent>(that.getFacultyresearchtostudents()));
		setThesiscommitteesForChair(new java.util.LinkedHashSet<edu.unf.cen6940.domain.Thesiscommittee>(that.getThesiscommitteesForChair()));
		setThesiscommitteesForCommitteeMember1(new java.util.LinkedHashSet<edu.unf.cen6940.domain.Thesiscommittee>(that.getThesiscommitteesForCommitteeMember1()));
		setThesiscommitteesForCommitteeMember5(new java.util.LinkedHashSet<edu.unf.cen6940.domain.Thesiscommittee>(that.getThesiscommitteesForCommitteeMember5()));
		setThesiscommitteesForCommitteeMember4(new java.util.LinkedHashSet<edu.unf.cen6940.domain.Thesiscommittee>(that.getThesiscommitteesForCommitteeMember4()));
		setThesiscommitteesForCommitteeMember3(new java.util.LinkedHashSet<edu.unf.cen6940.domain.Thesiscommittee>(that.getThesiscommitteesForCommitteeMember3()));
		setFacultyresearchs(new java.util.LinkedHashSet<edu.unf.cen6940.domain.Facultyresearch>(that.getFacultyresearchs()));
		setThesiscommitteesForCommitteeMember2(new java.util.LinkedHashSet<edu.unf.cen6940.domain.Thesiscommittee>(that.getThesiscommitteesForCommitteeMember2()));
	}

	/**
	 * Returns a textual representation of a bean.
	 *
	 */
	public String toString() {

		StringBuilder buffer = new StringBuilder();

		buffer.append("facultyId=[").append(facultyId).append("] ");
		buffer.append("nnumber=[").append(nnumber).append("] ");
		buffer.append("firstName=[").append(firstName).append("] ");
		buffer.append("lastName=[").append(lastName).append("] ");
		buffer.append("email=[").append(email).append("] ");
		buffer.append("url=[").append(url).append("] ");
		buffer.append("active=[").append(active).append("] ");

		return buffer.toString();
	}

	/**
	 */
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = (int) (prime * result + ((facultyId == null) ? 0 : facultyId.hashCode()));
		return result;
	}

	/**
	 */
	public boolean equals(Object obj) {
		if (obj == this)
			return true;
		if (!(obj instanceof Faculty))
			return false;
		Faculty equalCheck = (Faculty) obj;
		if ((facultyId == null && equalCheck.facultyId != null) || (facultyId != null && equalCheck.facultyId == null))
			return false;
		if (facultyId != null && !facultyId.equals(equalCheck.facultyId))
			return false;
		return true;
	}
}
